package com.chinaunicom.create.factory.factorymethod;

import com.chinaunicom.create.factory.APizza;
import com.chinaunicom.create.factory.BPizza;
import com.chinaunicom.create.factory.OtherPizza;
import com.chinaunicom.create.factory.Pizza;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2022/7/15 14:44
 * Description:
 */
public class BJFactory extends AbstarctMethod {

    
    @Override
    public Pizza createPizza(String type){
        System.out.println("create pizza.....");
        Pizza pizza = null;
        switch (type){
            case "A":
                pizza = new APizza();
                break;
            case "B":
                pizza = new BPizza();
                break;
            default:
                pizza = new OtherPizza();
                break;
        }
        return pizza;
    }
}
